package com.oa.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author FengMengHuo
 * 这是一个获取类的工具类
 * 通过spring来管理和发射对应的类
 */
@SuppressWarnings("unchecked")
public class AppUtil {
	private static ApplicationContext ctx = new ClassPathXmlApplicationContext("spring.xml");
	
	@SuppressWarnings("rawtypes") 
	public static <T> T getBean(String beanId, Class clz) {
		return (T) ctx.getBean(beanId, clz);
	}
}
